﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BusinessUnitListPage.aspx.cs" Inherits="Easy.Web.Pages.PrivilegePages.BusinessUnitListPage" %>

<!--张雨奇 2016.4.28-->
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <link href="/_css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="/_css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
    <link href="/_css/common.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="/_css/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="/_css/jstree.themes/default/style.min.css" />
    <link href="/_css/sort.css" rel="stylesheet" type="text/css" />

    <script src="/_js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script src="/_js/bootstrap.min.js" type="text/javascript"></script>
    <script src="/_js/json2.js" type="text/javascript"></script>
    <script src="/_js/jstree.min.js" type="text/javascript"></script>
    

    <script type="text/javascript" src="/_js/bootstrap-datetimepicker.min.js" charset="UTF-8"></script>
    <script src="/_js/common.js"></script>
    <script src="/_js/Core.js"></script>
    <script src="/_js/Core.View.js"></script>
    <script src="/_js/Core.Lookup.js" type="text/javascript"></script>
    <script src="/_js/BusinessUnitListPageHelper.js" type="text/javascript"></script>
    <script type="text/javascript" src="/Service/Data/JsHub.ashx?itemtype=view&entityname=<%=EntinyName %>&itemname=<%=ViewName %>"></script>
    <asp:Literal runat="server" ID="CoreScript"></asp:Literal>
    <style>
        html,body{margin:0;padding:0}
        .page-header {
            margin: 15px;
        }

            .page-header + .btn-primary {
                margin: 0 15px 10px 5px;
            }

        .panel-heading {
            padding: 3px 15px;
            height: 40px;
            line-height: 34px;
        }
        .panel-default{
            border:none;
        }
        .table-responsive{
            border:1px solid #ddd;
            padding:15px;
        }

        .header {
            margin: 10px 0 10px 15px;
            font-size: 0;
        }
        .header > span{
            margin-right: 5px;
        }
        .dropdown{
             cursor: pointer;
        }
        .form-group{
            margin:0;
            padding:10px;

              }
        .dropdown-menu {
            -webkit-border-radius: 0;
        }
        .button-panel{
            padding:0 10px 10px 10px;
        }
       .rebtn{
           margin-right:3px;
       }
       #ListContainer{
            margin-bottom:15px;
            border:1px solid #e1e6eb;
       }
       #ListContainer, #ListContainer-title, #ListContainer-body{
           padding:0;
       }
       #ListContainer-title .table, #ListContainer-body .table{
            margin:0;
            border:none;
       }
       #ListContainer-body .table{
            border-top:1px solid #e1e6eb;
       }
       #ListContainer-title .table thead tr th, #ListContainer-body .table thead tr td{
           border:none;
       }
       #ListContainer-title{
           position:relative;
            z-index:1;
        }
        #ListContainer-body {
             position:relative;
        }
        @media screen and (max-width: 767px){
            .table-responsive{
                margin-bottom:0;
                overflow:auto;
            }
        }
       #LookupListContainer{
        height:420px;
        width:558px;
        overflow:auto;
        margin-top:8px;
        border:1px solid #e1e6eb;
       }
       #LookupListContainer-title{
           position:relative;
           z-index:1;
       }
       #LookupListContainer-body{
           position:relative;
       }
       #LookupListContainer-title .table, #LookupListContainer-body .table{
           margin:0;
           border:none;
       }
        td {
            -ms-word-break: break-all;
            word-break: break-all;
        }
    </style>
    <title></title>
    <script type="text/javascript">
        window.onload = function () {
            $('#ErrorModal').modal({ show: false });
            InitTree($('#bussiness_unit_tree_div'), $('#ErrorModal'), $('#selected_nood'), null);
        };


    </script>
</head>
<body>
    <input id="selected_nood" type="hidden" value="no_nodes_are_selected" />
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-6" >
                <div class="header col-md-12">
                    <span><a href="#" class="btn btn-primary ng-binding" title="Create" onclick="InitTree($('#bussiness_unit_tree_div'), $('#ErrorModal'), $('#selected_nood'), 0, null);">刷新列表</a></span>
                    <span><a href="#" class="btn btn-primary ng-binding" title="Create" onclick="EditPreBusinessUnitButtonClicked($('#selected_nood'),$('#UpdatePreBusinessUnitJSTree'),$('#UpdatePreBusinessUnitModal'), $('#ErrorModal'),$('#PreBusinessUnitUpdateTargetID'),$('#NewPreBusinessUnitID'));">修改上级部门</a></span>
                    <span><a href="#" class="btn btn-primary ng-binding" title="Create" onclick="EditButtonClicked($('#selected_nood'),$('#selected_nood'));">修改</a></span>
                    <span><a href="#" class="btn btn-primary ng-binding" title="Create" onclick="NewButtonClicked();">新建</a></span>
                </div>
                <div class="col-md-12">
                    <div class="panel panel-default">
                    
                        <div class="panel-body">
                            <div class="table-responsive">
                                <div id="bussiness_unit_tree_div" >
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="header col-md-12" id="buttonheader">
                    <span style="display: none" id="btn_add"><a href="#" class="btn btn-primary ng-binding" title="Create" id="add_href" onclick="core.OpenEntity(this)"><span class="glyphicon glyphicon-plus"></span>&nbsp;新建</a></span>
                    <span style="display: none" id="btn_delete"><a href='#' class="btn btn-primary ng-binding" title="Delete" id="delete_href" onclick="core.SoftDelete(this);"><span class="glyphicon glyphicon-trash"></span>&nbsp;删除</a></span>
                    <span style="display: none" id="btn_assign"><a href='#' class="btn btn-primary ng-binding" title="Assign" id="assign_href" onclick="core.Assign();"><span class="glyphicon glyphicon-share"></span>&nbsp;分配</a></span>
                </div>
                <div class="col-md-12"  id="ListInnerContainer">
                    <form id="form1" runat="server">
                    </form>
                </div>
            </div>
        </div>
    </div>
     <div id="modaldiv">
    </div>
    <div id="UpdatePreBusinessUnitModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="UpdatePreBusinessUnitModal" aria-hidden="true">
        <div class="modal-dialog" style="width: 500px; height: 180px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h5 id="UpdatePreBusinessUnitModalLabel2">选择上级部门</h5>
                </div>
                <div class="modal-body">
                    <input type="hidden" value="no_nodes_are_selected" id="PreBusinessUnitUpdateTargetID" />
                    <input type="hidden" value="no_nodes_are_selected" id="NewPreBusinessUnitID" />
                    <div id="UpdatePreBusinessUnitJSTree">
                    </div>
                </div>
                <div class="modal-footer">
                    <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</button>
                    <button id="ConfirmChange" class="btn btn-primary" data-dismiss="modal" onclick="ConfirmUpdatePreBusinessUnit($('#NewPreBusinessUnitID'),$('#PreBusinessUnitUpdateTargetID'),$('#bussiness_unit_tree_div'),$('#INGModal'),$('#ErrorModal'),$('#selected_nood'))">确认更改</button>
                </div>
            </div>
        </div>
    </div>
    <div id="INGModal" class="modal fade " tabindex="-1" role="dialog" aria-labelledby="INGModal" aria-hidden="true">
        <div class="modal-dialog" style="width: 500px; height: 180px;">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 id="HintINGModal">提示</h5>
                </div>
                <div class="modal-body">
                    <p>正在修改</p>
                    <div id="progress" class="progress ">
                        <div id="progress_bar" class="progress-bar progress-bar-striped active  " role="progressbar" aria-valuemax="100" aria-valuemin="0" style="width: 100%;">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div id="ErrorModal" class="modal fade " tabindex="-1" role="dialog" aria-labelledby="ErrorModal" aria-hidden="true">
        <div class="modal-dialog" style="width: 500px; height: 180px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h5 id="myModalLabel">提示</h5>
                </div>
                <div class="modal-body">
                    <p>网络错误</p>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
